import java.awt.*;
import java.awt.event.*;

import com.golden.gamedev.engine.*;

public  class control implements BaseInput{
	

			
	public static void main() {
		
		int rotate=0;
		double x = 100;
		double y = 200;
		
		double speed = 3; 	   		
		
		boolean fire= false;
/*			double bullet_x_origin=0;
 	   		double bullet_y_origin=0;
 	   		double[] bullet_x =  new double[50];
 	   		double[] bullet_y =  new double[50];*/
		
		
		BaseInput engine = new control();
		
		engine.refresh();

		// game loop
		long elapsedTime = 0;
		while (true) {
			// update input
			
			
			// set to false so that it doesnt get stuck fireing
			fire = false;
			
			engine.update(elapsedTime);

			// poll input

		if (engine.isKeyDown(KeyEvent.VK_LEFT)){
			
			rotate=rotate-5;
        	
        	if (rotate <= 0) rotate += 360;
		}
		
		if (engine.isKeyDown(KeyEvent.VK_RIGHT)){
			
        	
        	rotate=rotate+5;

        	if (rotate >= 360) rotate =- 360;   
		}
		
		if (engine.isKeyDown(KeyEvent.VK_UP)){	
			
			y  =  y +  speed*Math.sin(( (rotate * Math.PI) )/180);
    		
    		x  =  x +  speed*Math.cos(( (rotate * Math.PI) )/180);
    		
		}
		
		if (engine.isKeyDown(KeyEvent.VK_DOWN)){
			
   			y  =  y -  (speed-2)*Math.sin(( (rotate * Math.PI) )/180);
   	   	  
   			x  =  x -  (speed-2)*Math.cos(( (rotate * Math.PI) )/180);
   			
		}
		
        if (engine.isKeyDown(KeyEvent.VK_SPACE)) {
        	
        	
        	fire = true;
/*        	ammo--;
        	
        	sbullet[ammo].setX(bullet_x_origin);
        	sbullet[ammo].setY(bullet_y_origin);
        	
        	
        	if (ammo<0) ammo=0;
        	
        	if (ammo>0){

        	bullet_x[ammo] =  bullet_x_origin + 50 * Math.cos(( (rotate * Math.PI) )/180);
        	bullet_y[ammo] =  bullet_y_origin + 50 * Math.sin(( (rotate * Math.PI) )/180); 
        
        	*/}
			// clean up input engine
			engine.cleanup();
		}

	}

	public void cleanup() {
		// TODO Auto-generated method stub
		
	}

	public int getKeyPressed() {
		// TODO Auto-generated method stub
		return 0;
	}

	public int getKeyReleased() {
		// TODO Auto-generated method stub
		return 0;
	}

	public int getMouseDX() {
		// TODO Auto-generated method stub
		return 0;
	}

	public int getMouseDY() {
		// TODO Auto-generated method stub
		return 0;
	}

	public int getMousePressed() {
		// TODO Auto-generated method stub
		return 0;
	}

	public int getMouseReleased() {
		// TODO Auto-generated method stub
		return 0;
	}

	public int getMouseX() {
		// TODO Auto-generated method stub
		return 0;
	}

	public int getMouseY() {
		// TODO Auto-generated method stub
		return 0;
	}

	public boolean isKeyDown(int arg0) {
		// TODO Auto-generated method stub
		return false;
	}

	public boolean isKeyPressed(int arg0) {
		// TODO Auto-generated method stub
		return false;
	}

	public boolean isKeyReleased(int arg0) {
		// TODO Auto-generated method stub
		return false;
	}

	public boolean isMouseDown(int arg0) {
		// TODO Auto-generated method stub
		return false;
	}

	public boolean isMouseExists() {
		// TODO Auto-generated method stub
		return false;
	}

	public boolean isMousePressed(int arg0) {
		// TODO Auto-generated method stub
		return false;
	}

	public boolean isMouseReleased(int arg0) {
		// TODO Auto-generated method stub
		return false;
	}

	public boolean isMouseVisible() {
		// TODO Auto-generated method stub
		return false;
	}

	public void mouseMove(int arg0, int arg1) {
		// TODO Auto-generated method stub
		
	}

	public void refresh() {
		// TODO Auto-generated method stub
		
	}

	public void setMouseVisible(boolean arg0) {
		// TODO Auto-generated method stub
		
	}

	public void update(long arg0) {
		// TODO Auto-generated method stub
		
	}
}